package com.aispeech.asr.apis.ssc.data.domain;

import java.io.IOException;

import com.aispeech.asr.comm.enums.EAudioType;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import lombok.Data;

@Data
public class PrepareAudioInfo {
    private String uid;
    private String audioPath;
    private boolean limitFlag = false;
    private ByteBuf buffer;
    private String vprResult;
    private float score;
    
    public PrepareAudioInfo(String uid,String audioPath) {
    	this.uid = uid;
    	this.audioPath = audioPath;
        buffer = Unpooled.buffer();
    }
    
    public void write(byte[] bytes) throws IOException {
        buffer.writeBytes(bytes);
    }

    public int bufferLength() {
        return buffer.readableBytes();
    }
    
    public ByteBuf getBuffer() {
    	return buffer;
    }
    
    public int writerIndex() {
        return buffer.writerIndex();
    }
}
